import request from '@/utils/request';
import { AxiosPromise } from 'axios';

export const indexStat = (): AxiosPromise<any> => {
  return request({
    url: '/index-stat',
    method: 'get'
  });
};

export const studentAttendanceStat = (timing: string): AxiosPromise<any> => {
  return request({
    url: '/student-attendance/stat?timing=' + timing,
    method: 'get'
  });
};

export const gradeAttendanceStat = (timing: string): AxiosPromise<any[]> => {
  return request({
    url: '/grade-attendance/stat?timing=' + timing,
    method: 'get'
  });
};

export const studentAttendanceDayStat = (): AxiosPromise<any> => {
  return request({
    url: '/student-attendance/day-stat',
    method: 'get'
  });
};

export const classAttendanceDayStat = (): AxiosPromise<any[]> => {
  return request({
    url: '/class-attendance/day-stat',
    method: 'get'
  });
};

export const shiftStat = (attendanceShift: number): AxiosPromise<any> => {
  return request({
    url: '/dormitory-shift/stat?attendanceShift=' + attendanceShift,
    method: 'get'
  });
};

export const buildingShiftStat = (attendanceShift: number): AxiosPromise<any> => {
  return request({
    url: '/dormitory-building/stat?attendanceShift=' + attendanceShift,
    method: 'get'
  });
};
